import React, { Component } from 'react';
import { Card, Table, Divider } from 'antd';
import WshTable from './WshTable';

const dataSource = [
  {
    key: '1',
    name: '胡彦斌',
    age: 32,
    address: '西湖区湖底公园1号',
  },
  {
    name: '胡彦祖',
    key: '2',
    age: '',
    address: '西湖区湖底公园1号',
  },
];

const columns = [
  {
    title: '姓名',
    dataIndex: 'name',
    key: 'name',
    sorter: true
  },
  {
    title: '年龄',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: '住址',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: '操作',
    key: 'action',
    render: (text, record) => (
      <span>
        <a>Invite {record.name}</a>
        <Divider type="vertical" />
        <a>Delete</a>
      </span>
    )
  }
];
class Tables extends Component {
  render() {
    return (
      <>
        <Card title="基础表格">
          <Table bordered dataSource={dataSource} columns={columns} />
        </Card>
        <Card title="自定义表格">
          <WshTable columns={columns} dataSource={dataSource} />
        </Card>
      </>
    );
  }
}

export default Tables;
